package controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import businnes.Client;
import dao.ClientDAO;

@Transactional
public class Admin {
	
	@Autowired
	private ClientDAO clientDAO;
	
	public Long addClient(Client client){
		return clientDAO.save(client);
	}
	
	public List<Client> getAll(){
		return clientDAO.list();
	}
	
	public Client getClient(Long idClient){
		return clientDAO.get(idClient);
	}
	
	public void updateClient(Client client){
		clientDAO.update(client);
	}

	public void setClientDAO(ClientDAO clientDAO) {
		this.clientDAO = clientDAO;
	}
	
	

}
